package com.kangyi.admin.service.Impl;

import cn.hutool.core.collection.CollUtil;
import com.kangyi.admin.mapper.OrganizationMapper;
import com.kangyi.admin.service.OrganizationService;
import com.kangyi.constant.MessageConstant;
import com.kangyi.exception.DataNotExistException;

import com.kangyi.vo.OrganizationVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Blank
 * @version 1.0
 */
@Service
public class OrganizationServiceImpl implements OrganizationService {

    @Autowired
    private OrganizationMapper organizationMapper;

    @Override
    public List<OrganizationVO> inquiryOrganization() {
        List<OrganizationVO> organizationVOList = organizationMapper.inquiryOrganization();
        if (CollUtil.isEmpty(organizationVOList)) {
            throw new DataNotExistException(MessageConstant.DATA_NOT_EXIST);
        }
        return organizationVOList;
    }
}
